<template>
	<view>
		<image class="img" src="../../../static/wallet/money.png" mode=""></image>
		<view class="mymoney">我的余额</view>
		<view class="number">{{ye}}</view>
		<view class="invesrt" @click="navto('./recharge')">充值</view>
		<view class="transfer" @click="navto('./transfer')">转账</view>
		<view class="transfer" @click="navto('./withdrawal')">提现</view>
	</view>
</template>

<script>
	import {userinfo} from"../../../api/user.js"
	export default{
		data(){
			return{
				ye:""
			}
		},
		onShow() {
			this.getuserinfo()
		},
		onNavigationBarButtonTap(e){
			uni.navigateTo({
				url:'./tish'
			})
		},
		methods:{
			navto(url){
				uni.navigateTo({
					url:url
				})
			},
			// 获取用户资料
			async getuserinfo(){
				let res=await this.get(userinfo)
				this.ye=res.data.balance
				uni.setStorageSync("user",res.data)
			}
		}
	}
</script>

<style>
	.img{
		width: 120rpx;
		height: 120rpx;
		margin-top: 157rpx; 
		margin-left: 315rpx;
	}
		
	.mymoney{
		font-size: 30rpx;
		margin-top: 40rpx;
		margin-left: 315rpx;
		color: #333333;
	}
	.number{
		width: 100%;
		font-size: 70rpx;
		font-weight: 800;
		color: #333333;
		margin-top: 30rpx;
		text-align: center;
	}
	.invesrt{
		width: 240rpx;
		height: 70rpx;
		background: linear-gradient(180deg, #F09238 0%, #EC5F2A 100%);
		border-radius: 12rpx;
		margin-top: 150rpx;
		margin-left: 255rpx;
		font-size: 30rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 70rpx;
	}
	.transfer{
		width: 240rpx;
		height: 70rpx;
		border-radius: 12rpx;
		margin-top: 30rpx;
		margin-left: 255rpx;
		font-size: 30rpx;
		border: 1px solid #F09238;
		color: #F09238;
		text-align: center;
		line-height: 70rpx;
	}
</style>
